home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 10.6 KB | 585 lines | [TEXT/MPS ] |
- ;
- ; File: Slots.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__SLOTS__') = 'UNDEFINED' THEN
- __SLOTS__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
- include 'Events.a'
- ENDIF
- ; include 'Quickdraw.a' ;
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
- ; include 'OSUtils.a' ;
- ; include 'Memory.a' ;
-
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
-
- fCardIsChanged EQU 1 ;Card is Changed field in StatusFlags field of sInfoArray
- fCkForSame EQU 0 ;For SearchSRT. Flag to check for SAME sResource in the table.
- fCkForNext EQU 1 ;For SearchSRT. Flag to check for NEXT sResource in the table.
- fWarmStart EQU 2 ;If this bit is set then warm start else cold start.
- stateNil EQU 0 ;State
- stateSDMInit EQU 1 ;:Slot declaration manager Init
- statePRAMInit EQU 2 ;:sPRAM record init
- statePInit EQU 3 ;:Primary init
- stateSInit EQU 4 ;:Secondary init
- ; flags for spParamData
- fall EQU 0 ; bit 0: set=search enabled/disabled sRsrc's
- foneslot EQU 1 ; 1: set=search sRsrc's in given slot only
- fnext EQU 2 ; 2: set=search for next sRsrc
-
- SlotIntQElement RECORD 0
- sqLink ds.l 1 ;ptr to next element
- sqType ds.w 1 ;queue type ID for validity
- sqPrio ds.w 1 ;priority
- sqAddr ds.l 1 ;interrupt service routine
- sqParm ds.l 1 ;optional A1 parameter
- sizeof EQU 16
- ENDR
-
- SpBlock RECORD 0
- spResult ds.l 1 ;FUNCTION Result
- spsPointer ds.l 1 ;structure pointer
- spSize ds.l 1 ;size of structure
- spOffsetData ds.l 1 ;offset/data field used by sOffsetData
- spIOFileName ds.l 1 ;ptr to IOFile name for sDisDrvrName
- spsExecPBlk ds.l 1 ;pointer to sExec parameter block.
- spParamData ds.l 1 ;misc parameter data (formerly spStackPtr).
- spMisc ds.l 1 ;misc field for SDM.
- spReserved ds.l 1 ;reserved for future expansion
- spIOReserved ds.w 1 ;Reserved field of Slot Resource Table
- spRefNum ds.w 1 ;RefNum
- spCategory ds.w 1 ;sType: Category
- spCType ds.w 1 ;Type
- spDrvrSW ds.w 1 ;DrvrSW
- spDrvrHW ds.w 1 ;DrvrHW
- spTBMask ds.b 1 ;type bit mask bits 0..3 mask words 0..3
- spSlot ds.b 1 ;slot number
- spID ds.b 1 ;structure ID
- spExtDev ds.b 1 ;ID of the external device
- spHwDev ds.b 1 ;Id of the hardware device.
- spByteLanes ds.b 1 ;bytelanes from card ROM format block
- spFlags ds.b 1 ;standard flags
- spKey ds.b 1 ;Internal use only
- sizeof EQU 56
- ENDR
-
- SInfoRecord RECORD 0
- siDirPtr ds.l 1 ;Pointer to directory
- siInitStatusA ds.w 1 ;initialization E
- siInitStatusV ds.w 1 ;status returned by vendor init code
- siState ds.b 1 ;initialization state
- siCPUByteLanes ds.b 1 ;0=[d0..d7] 1=[d8..d15]
- siTopOfROM ds.b 1 ;Top of ROM= $FssFFFFx: x is TopOfROM
- siStatusFlags ds.b 1 ;bit 0 - card is changed
- siTOConst ds.w 1 ;Time Out C for BusErr
- siReserved ds.b 2 ;reserved
- siROMAddr ds.l 1 ; addr of top of ROM
- siSlot ds.b 1 ; slot number
- siPadding ds.b 3 ; reserved
- sizeof EQU 24
- ENDR
-
- SDMRecord RECORD 0
- sdBEVSave ds.l 1 ;Save old BusErr vector
- sdBusErrProc ds.l 1 ;Go here to determine if it is a BusErr
- sdErrorEntry ds.l 1 ;Go here if BusErrProc finds real BusErr
- sdReserved ds.l 1 ;Reserved
- sizeof EQU 16
- ENDR
-
- FHeaderRec RECORD 0
- fhDirOffset ds.l 1 ;offset to directory
- fhLength ds.l 1 ;length of ROM
- fhCRC ds.l 1 ;CRC
- fhROMRev ds.b 1 ;revision of ROM
- fhFormat ds.b 1 ;format - 2
- fhTstPat ds.l 1 ;test pattern
- fhReserved ds.b 1 ;reserved
- fhByteLanes ds.b 1 ;ByteLanes
- sizeof EQU 20
- ENDR
-
- SEBlock RECORD 0
- seSlot ds.b 1 ;Slot number.
- sesRsrcId ds.b 1 ;sResource Id.
- seStatus ds.w 1 ;Status of code executed by sExec.
- seFlags ds.b 1 ;Flags
- seFiller0 ds.b 1 ;Filler, must be SignedByte to align on odd boundry
- seFiller1 ds.b 1 ;Filler
- seFiller2 ds.b 1 ;Filler
- seResult ds.l 1 ;Result of sLoad.
- seIOFileName ds.l 1 ;Pointer to IOFile name.
- seDevice ds.b 1 ;Which device to read from.
- sePartition ds.b 1 ;The partition.
- seOSType ds.b 1 ;Type of OS.
- seReserved ds.b 1 ;Reserved field.
- seRefNum ds.b 1 ;RefNum of the driver.
- seNumDevices ds.b 1 ; Number of devices to load.
- seBootState ds.b 1 ;State of StartBoot code.
- filler ds.b 1
- sizeof EQU 24
- ENDR
-
- ; Principle
- IF GENERATING68K THEN
- Macro
- _SReadByte
- moveq #0,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadByte
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadWord
- moveq #1,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadWord
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadLong
- moveq #2,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadLong
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SGetCString
- moveq #3,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SGetCString
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SGetBlock
- moveq #5,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SGetBlock
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SFindStruct
- moveq #6,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SFindStruct
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadStruct
- moveq #7,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadStruct
- ENDIF
-
- ; Special
- IF GENERATING68K THEN
- Macro
- _SReadInfo
- moveq #16,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadInfo
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadPRAMRec
- moveq #17,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadPRAMRec
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPutPRAMRec
- moveq #18,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SPutPRAMRec
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadFHeader
- moveq #19,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadFHeader
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SNextSRsrc
- moveq #20,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SNextSRsrc
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SNextTypeSRsrc
- moveq #21,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SNextTypeSRsrc
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SRsrcInfo
- moveq #22,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SRsrcInfo
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SCkCardStat
- moveq #24,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SCkCardStat
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadDrvrName
- moveq #25,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadDrvrName
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SFindDevBase
- moveq #27,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SFindDevBase
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SFindBigDevBase
- moveq #28,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SFindBigDevBase
- ENDIF
-
- ; Advanced
- IF GENERATING68K THEN
- Macro
- _InitSDeclMgr
- moveq #32,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT InitSDeclMgr
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPrimaryInit
- moveq #33,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SPrimaryInit
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SCardChanged
- moveq #34,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SCardChanged
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SExec
- moveq #35,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SExec
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SOffsetData
- moveq #36,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SOffsetData
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SInitPRAMRecs
- moveq #37,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SInitPRAMRecs
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SReadPBSize
- moveq #38,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SReadPBSize
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SCalcStep
- moveq #40,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SCalcStep
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SInitSRsrcTable
- moveq #41,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SInitSRsrcTable
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SSearchSRT
- moveq #42,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SSearchSRT
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SUpdateSRT
- moveq #43,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SUpdateSRT
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SCalcSPointer
- moveq #44,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SCalcSPointer
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SGetDriver
- moveq #45,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SGetDriver
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPtrToSlot
- moveq #46,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SPtrToSlot
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SFindSInfoRecPtr
- moveq #47,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SFindSInfoRecPtr
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SFindSRsrcPtr
- moveq #48,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SFindSRsrcPtr
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SDeleteSRTRec
- moveq #49,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SDeleteSRTRec
- ENDIF
-
- IF GENERATING68K THEN
- _OpenSlotSync: OPWORD $A200
- ELSE
- IMPORT OpenSlotSync
- ENDIF
-
- IF GENERATING68K THEN
- _OpenSlotAsync: OPWORD $A600
- ELSE
- IMPORT OpenSlotAsync
- ENDIF
-
- ; Device Manager Slot Support
- IF GENERATING68K THEN
- _SIntInstall: OPWORD $A075
- ELSE
- IMPORT SIntInstall
- ENDIF
-
- IF GENERATING68K THEN
- _SIntRemove: OPWORD $A076
- ELSE
- IMPORT SIntRemove
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SVersion
- moveq #8,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SVersion
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetSRsrcState
- moveq #9,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SetSRsrcState
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _InsertSRTRec
- moveq #10,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT InsertSRTRec
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SGetSRsrc
- moveq #11,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SGetSRsrc
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SGetTypeSRsrc
- moveq #12,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SGetTypeSRsrc
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SGetSRsrcPtr
- moveq #29,d0
- dc.w $A06E
- EndM
- ELSE
- IMPORT SGetSRsrcPtr
- ENDIF
-
- ENDIF ; __SLOTS__
-